Opening
the INF File
You must use
the SetupOpenInfFile
The following
example opens an INF file.
HINF MyInf; //variable to hold the INF
handle
PUINT ErrorLine; //variable to point to errors
returned
BOOL test; //variable to receive function
success
MyInf = SetupOpenInfFile (
szInfFileName, //the filename of the inf file to open
NULL, //optional
class information
INF_STYLE_WIN4, //the inf
style
ErrorLine //line number
of the syntax error
);
In the
preceding example, MyInf is the handle returned by SetupOpenInfFile
to the opened INF file. The parameter szInfFileName specifies the name
of the INF file to open. The INF class is specified as NULL. This indicates
that the Class key should be ignored. The INF_STYLE_WIN4 value specifies
that the INF file is formatted in the INF format used with Windows 95 and
Windows NT 4.0. The ErrorLine parameter is a pointer to a variable that
receives the line number of an error that the SetupOpenInfFile function
generates.
After an INF
file is opened, you can call the SetupOpenAppendInfFile
If you call
the SetupOpenAppendInfFile function and the filename passed to it is
NULL, then the function will search the Version
The following
example appends the szSecondInfFileName file to the open file, szInfFileName.
test = SetupOpenAppendInfFile (
szSecondInfFileName, //name of
the inf file to append
//to the
open inf file, if NULL,
//the fn
searches for the LayoutInf
//key in
the version section, and
//appends
the file specified there.
MyInf, //handle
of the open inf file
ErrorLine //pointer
to an unsigned integer that
//receives
error information
);
In the
example, szSecondInfFileName is the name of the file to append to the
open INF file. MyInf is the handle to the open INF file returned by the
previous call to the SetupOpenInfFile function. The parameter ErrorLine
points to a variable that will receive any error information generated by
the SetupOpenAppendInfFile function.